package demo.practice.leetcode;

public class P897 {
    private TreeNode target;
    private TreeNode current;

    public TreeNode increasingBST(TreeNode root) {
        if(root==null)
            return null;

        if(root.left!=null){
             increasingBST(root.left);
        }

        if(target==null){
            target= new TreeNode(root.val);
            current=target;
        }else {
            current.right= new TreeNode(root.val);
            current=current.right;
        }

        if(root.right!=null){
             increasingBST(root.right);
        }

        return target;
    }


//    public TreeNode increasingBST(TreeNode root,TreeNode target) {
//        if(root==null){
//
//        }
//        if(root.left!=null){
//            target.right=
//        }
//
//    }





}
